-- castle - "The Castle"

function autoexec()

  return
end

function refresh()
  return
end

function postexec()
return
end

function zone_handler(zn)
  if (zn == 1) then
    change_map("capital",20,1,20,1);

  elseif  (zn == 2) then
    book_talk(get_pidx(0));

  elseif  (zn == 3) then


  elseif  (zn == 4) then
    thought(HERO1," This is the castle. I better not risk it.");
    thought(HERO1," At least not straight under the guards noses.");

  elseif  (zn == 5) then               
    bubble(6,"Where do you think your going?.");

  elseif  (zn == 6) then
    touch_fire(get_pidx(0));

  elseif  (zn == 7) then
    thought(HERO1," Wow thats a suit of armor.");

  end
end

function entity_handler(en)
  if (en == 0) then
    bubble(0,"You can't go this way.");

  elseif  (en == 1) then
    bubble(1,"You can't go this way.");

  elseif  (en == 2) then
    bubble(2,"You can't go this way.");

  elseif  (en == 3) then
    bubble(3,"You can't go this way.");

  elseif  (en == 4) then
    bubble(4,"Welcome to the King's Court.");

  elseif  (en == 5) then
    bubble(5,"Hello, please enjoy your stay.");

  elseif  (en == 6) then
    bubble(6,"Welcome to the King's Court.");

  elseif  (en == 7) then
    bubble(7,"Welcome to the King's Court.");

  elseif  (en == 8) then
    bubble(8,"Welcome to the King's Court.");

  elseif  (en == 9) then
    bubble(9,"Welcome to the King's Court.");

  elseif  (en == 10) then
   if (get_progress(P_QUEST1) == 0) then
    set_progress(P_QUEST1,1);

    bubble(10,"I King Joktam, have summoned you, to ask you....");
    bubble(10,"No... To request that you go on a quest for me.");
    bubble(10,"Someone is missing...");
    bubble(HERO1,"A Princess?");
    bubble(10,"No...");
    bubble(HERO1,"A Prince?");
    bubble(10,"No...");
    bubble(HERO1,"A long lost cousin that you didn't know about until today?");
    bubble(10,"No! A girl from the village of Elerta.");
    bubble(HERO1,"A girl?");
    bubble(10,"Yes.");
    bubble(HERO1,"Why?");
    bubble(10,"I will give you a vast reward.");
    bubble(HERO1,"Why?");
    bubble(10,"Don't question the King.");
    bubble(10,"Your quest will be long and hard.");
    thought(HERO1,"I bet she got lost picking flowers.");
    bubble(10,"Heres 500 gold pieces to get you on your way.");
    msg("You've acquired 500 gp!",255,0);
    set_gp(get_gp()+500);
    thought(HERO1,"Free gold!! This guy isn't too bad, even if he is off his throne.");
    bubble(10,"Beware! There will be many hidden dangers on this quest.");
    thought(HERO1,"That must be a requirement for an adventure.");
    bubble(10,"The village of Elerta is due south from my castle.");
       end
if (get_progress(P_QUEST1) == 1) then
   bubble(10,"Why are you still here?");
end

  elseif  (en == 11) then
    bubble(11,"Good luck hero.")

end
       end

